using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace BabyCloudDrives.DesktopApp.Models
{
    public class SkyDriveEntryBase
    {
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; }

        [JsonProperty(PropertyName = "from")]
        public SkyDriveFrom From { get; set; }

        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        [JsonProperty(PropertyName = "description")]
        public string Description { get; set; }

        [JsonProperty(PropertyName = "parent_id")]
        public string ParentId { get; set; }

        [JsonProperty(PropertyName = "upload_location")]
        public string Uploadlocation { get; set; }

        [JsonProperty(PropertyName = "is_embeddable")]
        public bool IsEmbeddable { get; set; }

        [JsonProperty(PropertyName = "count")]
        public int Count { get; set; }

        [JsonProperty(PropertyName = "link")]
        public string Link { get; set; }

        [JsonProperty(PropertyName = "type")]
        public string Type { get; set; }

        [JsonProperty(PropertyName = "shared_with")]
        public SkyDriveSharedWith SharedWith { get; set; }

        [JsonProperty(PropertyName = "created_time")]
        [JsonConverter(typeof (IsoDateTimeConverter))]
        public DateTime CreatedTime { get; set; }

        [JsonProperty(PropertyName = "updated_time")]
        [JsonConverter(typeof (IsoDateTimeConverter))]
        public DateTime UpdatedTime { get; set; }

        [JsonIgnore]
        public SkyDriveEntryBase ParentFolder { get; set; }

        [JsonIgnore]
        public IList<SkyDriveFolder> ChildFolders { get; set; }

        [JsonIgnore]
        public IList<SkyDriveFile> ChildFiles { get; set; }
    }
}